home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 42 / Amiga Format AFCD42 (Issue 126, Aug 1999).iso / -serious- / programming / other / jikes / src / error.h < prev    next >
C/C++ Source or Header  |  1999-05-14  |  31KB  |  594 lines

  1. // $Id: error.h,v 1.12 1999/03/09 14:37:16 shields Exp $
  2. //
  3. // This software is subject to the terms of the IBM Jikes Compiler
  4. // License Agreement available at the following URL:
  5. // http://www.ibm.com/research/jikes.
  6. // Copyright (C) 1996, 1998, International Business Machines Corporation
  7. // and others.  All Rights Reserved.
  8. // You must accept the terms of that agreement to use this software.
  9. //
  10. #ifndef error_INCLUDED
  11. #define error_INCLUDED
  12.  
  13. #include "config.h"
  14. #include "stream.h"
  15. #include "tuple.h"
  16.  
  17. class Control;
  18. class LexStream;
  19. class Ast_CompilationUnit;
  20. class SymbolSet;
  21. class Semantic;
  22.  
  23. class SemanticError
  24. {
  25. public:
  26.     enum SemanticErrorKind
  27.     {
  28.         BAD_ERROR,
  29.         DEFAULT_ERROR,
  30.  
  31.         INVALID_OPTION,
  32.         INVALID_K_OPTION,
  33.         INVALID_K_TARGET,
  34.         INVALID_TAB_VALUE,
  35.         INVALID_DIRECTORY,
  36.         UNSUPPORTED_OPTION,
  37.  
  38.         NO_CURRENT_DIRECTORY,
  39.         CANNOT_OPEN_ZIP_FILE,
  40.         PACKAGE_NOT_FOUND,
  41.         CANNOT_OPEN_DIRECTORY,
  42.         BAD_INPUT_FILE,
  43.         UNREADABLE_INPUT_FILE,
  44.         CANNOT_REOPEN_FILE,
  45.         CANNOT_WRITE_FILE,
  46.         CANNOT_COMPUTE_COLUMNS,
  47.         EMPTY_DECLARATION,
  48.         REDUNDANT_ABSTRACT,
  49.         REDUNDANT_FINAL,
  50.         REDUNDANT_PUBLIC,
  51.         REDUNDANT_STATIC,
  52.         OBSOLESCENT_ABSTRACT,
  53.         OBSOLESCENT_BRACKETS,
  54.         NO_TYPES,
  55.         MULTIPLE_PUBLIC_TYPES,
  56.         TYPE_IN_MULTIPLE_FILES,
  57.         PACKAGE_TYPE_CONFLICT,
  58.         DIRECTORY_FILE_CONFLICT,
  59.         FILE_FILE_CONFLICT,
  60.         MISMATCHED_TYPE_AND_FILE_NAMES,
  61.         REFERENCE_TO_TYPE_IN_MISMATCHED_FILE,
  62.         DUPLICATE_INNER_TYPE_NAME,
  63.         DUPLICATE_TYPE_DECLARATION,
  64.         DUPLICATE_ACCESS_MODIFIER,
  65.         DUPLICATE_MODIFIER,
  66.         FINAL_ABSTRACT_CLASS,
  67.         VOLATILE_FINAL,
  68.         FINAL_VOLATILE,
  69.         INVALID_TOP_LEVEL_CLASS_MODIFIER,
  70.         INVALID_INNER_CLASS_MODIFIER,
  71.         INVALID_STATIC_INNER_CLASS_MODIFIER,
  72.         INVALID_LOCAL_CLASS_MODIFIER,
  73.         INVALID_INTERFACE_MODIFIER,
  74.         INVALID_FIELD_MODIFIER,
  75.         INVALID_LOCAL_MODIFIER,
  76.         INVALID_METHOD_MODIFIER,
  77.         INVALID_SIGNATURE_MODIFIER,
  78.         INVALID_CONSTRUCTOR_MODIFIER,
  79.         INVALID_CONSTANT_MODIFIER,
  80.         UNINITIALIZED_FIELD,
  81.         PARENT_TYPE_IN_UNNAMED_PACKAGE,
  82.         RECOMPILATION,
  83.         TYPE_NOT_FOUND,
  84.         DUPLICATE_ON_DEMAND_IMPORT,
  85.         NOT_A_TYPE,
  86.         NOT_A_CLASS,
  87.         NOT_AN_INTERFACE,
  88.         SUPER_IS_FINAL,
  89.         OBJECT_WITH_SUPER_TYPE,
  90.         OBJECT_HAS_NO_SUPER_TYPE,
  91.         DUPLICATE_FIELD,
  92.         DUPLICATE_METHOD,
  93.         DUPLICATE_CONSTRUCTOR,
  94.         MISMATCHED_INHERITED_METHOD,
  95.         MISMATCHED_INHERITED_METHOD_EXTERNALLY,
  96.         DUPLICATE_FORMAL_PARAMETER,
  97.         MISMATCHED_CONSTRUCTOR_NAME,
  98.         METHOD_WITH_CONSTRUCTOR_NAME,
  99.         DUPLICATE_LOCAL_VARIABLE_DECLARATION,
  100.         DUPLICATE_LOCAL_TYPE_DECLARATION,
  101.         MULTIPLE_DEFAULT_LABEL,
  102.         UNDECLARED_LABEL,
  103.         DUPLICATE_LABEL,
  104.         CATCH_PRIMITIVE_TYPE,
  105.         CATCH_ARRAY_TYPE,
  106.         AMBIGUOUS_NAME,
  107.         FIELD_IS_TYPE,
  108.         FIELD_NOT_FOUND,
  109.         FIELD_NAME_MISSPELLED,
  110.         FIELD_WITH_PRIVATE_ACCESS_NOT_ACCESSIBLE,
  111.         FIELD_WITH_DEFAULT_ACCESS_NOT_ACCESSIBLE,
  112.         NAME_NOT_FOUND,
  113.         METHOD_NOT_FIELD,
  114.         NAME_NOT_YET_AVAILABLE,
  115.         NAME_NOT_VARIABLE,
  116.         NAME_NOT_CLASS_VARIABLE,
  117.         NOT_A_NUMERIC_VARIABLE,
  118.         METHOD_NOT_FOUND,
  119.         METHOD_NAME_NOT_FOUND_IN_TYPE,
  120.         METHOD_NAME_MISSPELLED,
  121.         METHOD_WITH_PRIVATE_ACCESS_NOT_ACCESSIBLE,
  122.         METHOD_WITH_DEFAULT_ACCESS_NOT_ACCESSIBLE,
  123.         HIDDEN_METHOD_IN_ENCLOSING_CLASS,
  124.         FIELD_NOT_METHOD,
  125.         TYPE_NOT_METHOD,
  126.         TYPE_NOT_FIELD,
  127.         METHOD_NOT_CLASS_METHOD,
  128.         AMBIGUOUS_CONSTRUCTOR_INVOCATION,
  129.         AMBIGUOUS_METHOD_INVOCATION,
  130.         CONSTRUCTOR_NOT_FOUND,
  131.         METHOD_FOUND_FOR_CONSTRUCTOR,
  132.         ABSTRACT_TYPE_CREATION,
  133.         INVALID_INSTANCEOF_CONVERSION,
  134.         INVALID_CAST_CONVERSION,
  135.         INVALID_CAST_TYPE,
  136.         INCOMPATIBLE_TYPE_FOR_INITIALIZATION,
  137.         INCOMPATIBLE_TYPE_FOR_ASSIGNMENT,
  138.         INCOMPATIBLE_TYPE_FOR_BINARY_EXPRESSION,
  139.         INCOMPATIBLE_TYPE_FOR_CONDITIONAL_EXPRESSION,
  140.         VOID_ARRAY,
  141.         VOID_TYPE_IN_EQUALITY_EXPRESSION,
  142.         TYPE_NOT_THROWABLE,
  143.         TYPE_NOT_PRIMITIVE,
  144.         TYPE_NOT_INTEGRAL,
  145.         TYPE_NOT_NUMERIC,
  146.         TYPE_NOT_INTEGER,
  147.         TYPE_NOT_BOOLEAN,
  148.         TYPE_NOT_ARRAY,
  149.         TYPE_NOT_REFERENCE,
  150.         TYPE_NOT_VALID_FOR_SWITCH,
  151.         TYPE_IS_VOID,
  152.         VALUE_NOT_REPRESENTABLE_IN_TYPE,
  153.         DUPLICATE_CASE_VALUE,
  154.         MISPLACED_THIS_EXPRESSION,
  155.         MISPLACED_SUPER_EXPRESSION,
  156.         TARGET_VARIABLE_IS_FINAL,
  157.         FINAL_VARIABLE_TARGET_IN_LOOP,
  158.         UNINITIALIZED_FINAL_VARIABLE,
  159.         UNINITIALIZED_STATIC_FINAL_VARIABLE,
  160.         UNINITIALIZED_FINAL_VARIABLE_IN_CONSTRUCTOR,
  161.         INIT_SCALAR_WITH_ARRAY,
  162.         INIT_ARRAY_WITH_SCALAR,
  163.         INVALID_BYTE_VALUE,
  164.         INVALID_SHORT_VALUE,
  165.         INVALID_CHARACTER_VALUE,
  166.         INVALID_INT_VALUE,
  167.         INVALID_LONG_VALUE,
  168.         INVALID_FLOAT_VALUE,
  169.         INVALID_DOUBLE_VALUE,
  170.         INVALID_STRING_VALUE,
  171.         RETURN_STATEMENT_IN_INITIALIZER,
  172.         MISPLACED_RETURN_WITH_EXPRESSION,
  173.         MISPLACED_RETURN_WITH_NO_EXPRESSION,
  174.         MISMATCHED_RETURN_AND_METHOD_TYPE,
  175.         EXPRESSION_NOT_THROWABLE,
  176.         BAD_THROWABLE_EXPRESSION_IN_TRY,
  177.         BAD_THROWABLE_EXPRESSION_IN_METHOD,
  178.         BAD_THROWABLE_EXPRESSION,
  179.         MISPLACED_BREAK_STATEMENT,
  180.         MISPLACED_CONTINUE_STATEMENT,
  181.         MISPLACED_EXPLICIT_CONSTRUCTOR_INVOCATION,
  182.         INVALID_CONTINUE_TARGET,
  183.         NON_ABSTRACT_TYPE_CONTAINS_ABSTRACT_METHOD,
  184.         NON_ABSTRACT_TYPE_INHERITS_ABSTRACT_METHOD,
  185.         NON_ABSTRACT_TYPE_INHERITS_ABSTRACT_METHOD_FROM_ABSTRACT_CLASS,
  186.         NON_ABSTRACT_TYPE_CANNOT_OVERRIDE_DEFAULT_ABSTRACT_METHOD,
  187.         NO_ABSTRACT_METHOD_IMPLEMENTATION,
  188.         DUPLICATE_INTERFACE,
  189.         UNKNOWN_QUALIFIED_NAME_BASE,
  190.         UNKNOWN_AMBIGUOUS_NAME,
  191.         CIRCULAR_INTERFACE,
  192.         CIRCULAR_CLASS,
  193.         TYPE_NOT_ACCESSIBLE,
  194.         PRIVATE_FIELD_NOT_ACCESSIBLE,
  195.         PROTECTED_FIELD_NOT_ACCESSIBLE,
  196.         DEFAULT_FIELD_NOT_ACCESSIBLE,
  197.         PRIVATE_METHOD_NOT_ACCESSIBLE,
  198.         PROTECTED_METHOD_NOT_ACCESSIBLE,
  199.         DEFAULT_METHOD_NOT_ACCESSIBLE,
  200.         PRIVATE_CONSTRUCTOR_NOT_ACCESSIBLE,
  201.         PROTECTED_CONSTRUCTOR_NOT_ACCESSIBLE,
  202.         DEFAULT_CONSTRUCTOR_NOT_ACCESSIBLE,
  203.         CONSTRUCTOR_DOES_NOT_THROW_THIS_EXCEPTION,
  204.         CONSTRUCTOR_DOES_NOT_THROW_SUPER_EXCEPTION,
  205.         PARAMETER_REDECLARED,
  206.         BAD_ABSTRACT_METHOD_MODIFIER,
  207.         ABSTRACT_METHOD_MODIFIER_CONFLICT,
  208.         ABSTRACT_METHOD_INVOCATION,
  209.         FINAL_METHOD_OVERRIDE,
  210.         FINAL_METHOD_OVERRIDE_EXTERNALLY,
  211.         PRIVATE_METHOD_OVERRIDE,
  212.         PRIVATE_METHOD_OVERRIDE_EXTERNALLY,
  213.         INSTANCE_METHOD_OVERRIDE,
  214.         INSTANCE_METHOD_OVERRIDE_EXTERNALLY,
  215.         CLASS_METHOD_OVERRIDE,
  216.         CLASS_METHOD_OVERRIDE_EXTERNALLY,
  217.         MISMATCHED_OVERRIDDEN_EXCEPTION,
  218.         MISMATCHED_OVERRIDDEN_EXCEPTION_EXTERNALLY,
  219.         ABSTRACT_METHOD_WITH_BODY,
  220.         NON_ABSTRACT_METHOD_WITHOUT_BODY,
  221.         BAD_ACCESS_METHOD_OVERRIDE,
  222.         BAD_ACCESS_METHOD_OVERRIDE_EXTERNALLY,
  223.         STATIC_OVERRIDE_ABSTRACT,
  224.         STATIC_OVERRIDE_ABSTRACT_EXTERNALLY,
  225.         CIRCULAR_THIS_CALL,
  226.         INSTANCE_VARIABLE_IN_EXPLICIT_CONSTRUCTOR_INVOCATION,
  227.         INSTANCE_METHOD_IN_EXPLICIT_CONSTRUCTOR_INVOCATION,
  228.         SYNTHETIC_VARIABLE_ACCESS,
  229.         SYNTHETIC_METHOD_INVOCATION,
  230.         THIS_IN_EXPLICIT_CONSTRUCTOR_INVOCATION,
  231.         SUPER_IN_EXPLICIT_CONSTRUCTOR_INVOCATION,
  232.         EXPRESSION_NOT_CONSTANT,
  233.         UNCATCHABLE_METHOD_THROWN_CHECKED_EXCEPTION,
  234.         UNCATCHABLE_CONSTRUCTOR_THROWN_CHECKED_EXCEPTION,
  235.         UNREACHABLE_CATCH_CLAUSE,
  236.         UNREACHABLE_STATEMENT,
  237.         UNREACHABLE_STATEMENTS,
  238.         UNREACHABLE_CONSTRUCTOR_BODY,
  239.         BLOCKED_CATCH_CLAUSE,
  240.         VARIABLE_NOT_DEFINITELY_ASSIGNED,
  241.         TYPED_METHOD_WITH_NO_RETURN,
  242.  
  243.         DEFAULT_METHOD_NOT_OVERRIDDEN,
  244.  
  245.         ONE_UNNAMED_PACKAGE,
  246.         TYPE_NOT_IN_UNNAMED_PA